<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<nav id="mainnav-container">
    <div id="mainnav">
        <div id="mainnav-menu-wrap">
            <div class="nano" id="pjax-nav-div">
                <div class="nano-content">
                    <div id="mainnav-profile"
                         class="mainnav-profile <c:if test='${setting.flShowUserImg == 0 }'>hidden </c:if> ">
                        <div class="profile-wrap">
                            <div class="pad-btm">
                                <span class="label label-success pull-right">管理员</span>
                                <img class="img-circle img-sm img-border"
                                     src="${sysUser.flAvatar}"
                                     alt="Profile Picture">
                            </div>
                            <a href="#profile-nav" class="box-block" data-toggle="collapse" aria-expanded="false">
                                            <span class="pull-right">
                                                <i class="dropdown-caret"></i>
                                            </span>
                                <p class="mnp-name">${sysUser.flName}</p>
                                <span class="mnp-desc">${sysUser.flEmail}</span>
                            </a>
                        </div>
                    </div>
                        <ul id="mainnav-menu" class="list-group">
                            <li class="active-link">
                                <a onclick="doPjax('${pageContext.request.contextPath}/sysUser/index')"
                                   href="javascript:void(0);">
                                    <i class="demo-psi-home"></i>
                                    <span class="menu-title">
												<strong>首页</strong>
											</span>
                                </a>
                            </li>
                            <!-- ！！！动态菜单！！！开始！！！下面受到权限控制，使用sql查询出来的 -->
                            <%--<li class="list-header"></li><!-- 占位 -->--%>
                            <!-- ！！！动态菜单！！！结束！！！ -->
                            <c:forEach items="${res}" var="parent">
                                <li>
                                    <a href="#">
                                        <i class="${parent.attributes.icon}"></i>
                                        <span class="menu-title">${parent.text}</span>
                                        <i class="arrow"></i>
                                    </a>
                                    <ul class="collapse">
                                        <c:forEach items="${parent.children}" var="children">
                                            <li>
                                                <a onclick="doPjax('${pageContext.request.contextPath}${children.attributes.url}','${children.text}')"
                                                   href="javascript:void(0);">${children.text}</a></li>
                                        </c:forEach>
                                    </ul>

                                </li>
                            </c:forEach>
                        </ul>
                    </div>
                </div>
            </div>
        </div>
    </div>
</nav>
